
<head>
	<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
	<script src="Highlighter.js" type="text/javascript"></script>
	<script type="text/javascript">
		var scr_str = null;
		var online = false;
		var logger_src = online?"http://jskfs.googlecode.com/svn/trunk/jslogger/logger.js":"logger.js";
		function copyCode() {
			if(scr_str!=null){
				var target = document.getElementById("k_code");
				var rng = document.body.createTextRange();
				rng.moveToElementText(target);
				rng.scrollIntoView();
				rng.select();
				rng.execCommand("Copy");
				rng.collapse(false);
			}else{
				alert("请先生成代码!");
			}
		}
		function push(array,str){
			if(str.length>0){
				array.push(str);
			}
		}
		
		function execute(){
			if(scr_str!=null){
				var ifrdoc = document.getElementById("ifr").contentWindow.document;
				ifrdoc.designMode = "on"; //文档进入可编辑模式
				ifrdoc.open(); //打开流
				ifrdoc.write(scr_str); 
				ifrdoc.close(); //关闭流
				ifrdoc.designMode ="off"; //文档进入非可编辑模式
			}else{
				alert("请先生成代码!");
			}
		}
		

		function ch(sr){
			var groups = document.getElementsByName(sr.id);
			for ( var i = groups.length - 1; i >= 0; i--){
				groups[i].disabled=sr.checked?false:true;
			}
			sr.disabled=false;
			buildcode();
		}
		
		function getV(name){
			var check = document.getElementById(name);
			if(check &&check.checked){
				var groups = document.getElementsByName(name);
				for ( var i = groups.length - 1; i >= 0; i--){
					if (groups[i].checked && groups[i].value!=-1){
						var value = groups[i].value;
						if(value=="true"||value=="false"){
							return name+"="+value;
						}else{
						    return name+"=\""+value+"\"";
						}
					}
				}
			}
			return "";
		}
		function buildcode(){
			var target = document.getElementById("k_code");
			arrs = new Array();
			push(arrs,getV("enabled"));
			push(arrs,getV("lang"));
			push(arrs,getV("time"));
			push(arrs,getV("contextmenu"));
			push(arrs,getV("highlighter"));
			push(arrs,getV("beautify"));
			push(arrs,getV("ease"));
			push(arrs,getV("cookie"));
			push(arrs,getV("simplemode"));
			push(arrs,getV("min"));
			push(arrs,getV("moveborder"));
			push(arrs,getV("debug"));
			push(arrs,getV("skinid"));
			scr_str = "<script src=\""+logger_src+"\" "+arrs.join(" ")+"><\/script>";
			target.innerHTML = Highlighter.Execute(scr_str,"html");
			execute();
		}
	</script>
</head>
<body onload="buildcode()">
<table>
	<tr><td colspan=2><div id="k_code" style="background-color:#FFF8DC;FONT-SIZE: 14px;font-family:consolas;top:20px;width:1124px;height:60px;border:solid 1px #778899;padding:15px"></div></td></tr>
	<tr>
		<td>
			<table style="width:300px;height:480px;">
				<tr><td align="right">是否启用日志功能:<input type="checkbox" onclick="ch(this)" checked id="enabled"></td><td><input type="radio" onclick="buildcode()" value="true" checked name="enabled">启用<input type="radio" onclick="buildcode()" value="false" name="enabled">禁用</td></tr>
				<tr><td align="right">界面初始语言:<input type="checkbox" onclick="ch(this)" checked id="lang"></td><td><input type="radio" onclick="buildcode()" value="cn" checked name="lang">中文<input type="radio" value="en" onclick="buildcode()" name="lang">英文</td></tr>
				<tr><td align="right">是否显示时间:<input type="checkbox" onclick="ch(this)" checked id="time"></td><td><input type="radio" onclick="buildcode()" value="true"  name="time">显示<input type="radio" value="false" onclick="buildcode()" checked name="time">隐藏</td></tr>
				<tr><td align="right">是否启用右键:<input type="checkbox" onclick="ch(this)" checked id="contextmenu"></td><td><input type="radio" onclick="buildcode()" value="true" checked name="contextmenu">启用<input type="radio" onclick="buildcode()" value="false" name="contextmenu">禁用</td></tr>
				<tr><td align="right">代码高亮:<input type="checkbox" onclick="ch(this)" checked id="highlighter"></td><td><input type="radio" onclick="buildcode()" value="true" checked name="highlighter">启用<input type="radio" onclick="buildcode()" value="false" name="highlighter">禁用</td></tr>
				<tr><td align="right">代码格式化:<input type="checkbox" onclick="ch(this)" checked id="beautify"></td><td><input type="radio" onclick="buildcode()" value="true" checked name="beautify">启用<input type="radio" onclick="buildcode()" value="false" name="beautify">禁用</td></tr>
				<tr><td align="right">缓动效果:<input type="checkbox" onclick="ch(this)" checked id="ease"></td><td><input type="radio" onclick="buildcode()" value="true" checked name="ease">启用<input type="radio" onclick="buildcode()" value="false" name="ease">禁用</td></tr>
				<tr><td align="right">是否启用cookie:<input type="checkbox" onclick="ch(this)" checked id="cookie"></td><td><input type="radio" onclick="buildcode()" value="true" checked name="cookie">启用<input type="radio" onclick="buildcode()" value="false" name="cookie">禁用</td></tr>
				<tr><td align="right">控制台显示模式:<input type="checkbox" onclick="ch(this)" checked id="simplemode"></td><td><input type="radio" onclick="buildcode()" value="true" checked name="simplemode">简易<input type="radio" onclick="buildcode()" value="false" name="simplemode">标准</td></tr>
				<tr><td align="right">初始最小化显示:<input type="checkbox" onclick="ch(this)" checked id="min"></td><td><input type="radio" onclick="buildcode()" value="true"  name="min">启用<input type="radio" value="false" onclick="buildcode()" checked name="min">禁用</td></tr>
				<tr><td align="right">控制台拖拽模式:<input type="checkbox" onclick="ch(this)" checked id="moveborder"></td><td><input type="radio" onclick="buildcode()" value="true" checked name="moveborder">炫酷<input type="radio" onclick="buildcode()" value="false" name="moveborder">标准</td></tr>
				<tr><td align="right">是否启用执行:<input type="checkbox" onclick="ch(this)" checked id="debug"></td><td><input type="radio" onclick="buildcode()" value="true"  name="debug">启用<input type="radio" value="false" onclick="buildcode()" checked name="debug">禁用</td></tr>
				<tr><td align="right" valign="top">皮肤设置:<input type="checkbox" onclick="ch(this)" checked id="skinid"></td>
					<td><input type="radio" onclick="buildcode()" value="0" checked name="skinid">经典橘黄<br>
						<input type="radio" onclick="buildcode()" value="1" name="skinid">蓝色Ⅰ<br>
						<input type="radio" onclick="buildcode()" value="2" name="skinid">蓝色Ⅱ<br>
						<input type="radio" onclick="buildcode()" value="3" name="skinid">红色<br>
						<input type="radio" onclick="buildcode()" value="4" name="skinid">紫色<br>
						<input type="radio" onclick="buildcode()" value="5" name="skinid">经典淡蓝
					</td>
				</tr>
				<tr><td colspan=2 align="right"><input type="button" onclick="copyCode()" style="FONT-SIZE:14px;height:30px;width:150px" value="复制代码"></td></tr>
			</table>
		</td>
		<td valign="top"><iframe frameborder="0" id="ifr" style="height:480px;width:824px;" src="#"></iframe></td>
	</tr>
</table>

</body>

